  {% extends "myadmin/base.html" %}

  {% block mainbody %}
  <script type="text/javascript">
  function insertManager() {
    var password = document.getElementById("pw1").value;
    var repassword = document.getElementById("pw2").value;
       if(password != repassword){
          window.alert("两次输入的密码不一致");
          return false;
        }
        return true;
    }
  </script> 
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        会员管理
        <small>订餐系统后台管理</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="{% url 'myadmin_index' %}"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li class="active">会员管理</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">

      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
                <h2 class="box-title"> <span class="glyphicon glyphicon-calendar" aria-hidden="true">添加会员信息</h2>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" action="{% url 'myadmin_users_insert' %}" method="post">
            {% csrf_token %}
              <div class="box-body">
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">会员账号：</label>

                  <div class="col-sm-4">
                    <input type="text" name="username" class="form-control" id="inputEmail3">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">真实姓名：</label>

                  <div class="col-sm-4">
                    <input type="text" name="nickname" class="form-control" id="inputEmail3">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">会员密码：</label>

                  <div class="col-sm-4">
                    <input type="password" name="password" class="form-control" id="pw1" >
                  </div>
                </div>
                
                 <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">重复密码：</label>

                  <div class="col-sm-4">
                    <input type="password" name="repassword" class="form-control" id="pw2" >
                  </div>
                </div>

              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <div class="col-sm-offset-2 col-sm-10">
                  <button type="submit" value="添加" class="btn btn-primary" onclick="return insertManager()">提交</button> 
                  <button type="reset" class="btn btn-default">重置</button>
                <div class="col-sm-offset-2 col-sm-10">
              </div>
              <!-- /.box-footer -->
            </form>
          </div>
          <!-- /.box -->
        </div>
      </div>

    </section>
    <!-- /.content -->
  </div>
  
  {% endblock %}